import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import org.joda.time.DateTime

String s1 = "s111111"

def s2 = "s22222"

def list = []

def map = [:]

//处理日期
def date = new Date().format("yyyy-MM-dd HH:mm:ss")

//joda-time
def jodaTime = new DateTime().minusDays(1).toDate().format("yyyy-MM-dd HH:mm:ss")

println(date)
println(jodaTime)

//json字符串转json
def jsonString = """{"a":"s","b":1,"c":true}"""
def json = new JsonSlurper().parseText(jsonString)
json.each { k, v ->
    println("k:${k}")
    println("v:${v}")
    println("v is class of      ${v.class}")
}
//json转json字符串
def json2str = JsonOutput.toJson(json)
println(json2str)
